# ---------------------------------echojs-----------------------------------
# windowaddEvent
snippet window.addevent
	window.addEvent('domready', function(){
		${1}
	});
# checkAll
snippet checkAll
	$checkAll(parent, chkall)
# getCheckValues()
snippet getCheckValues-->return_ids
	$getCheckValues(parent, chkall)
# echoAjax
snippet ajax(echoAjax)
	new echoAjax({url:${1:url}, params:${2:params}, reLoad:true}).fire();
# mootoosAjax
snippet ajax(mootools) 
	new Request.JSON({
		url: "/${1:url}/?id="+Math.random(),
		method: "${2:POST}",
		data: ${3:params},
		onSuccess: function(response){
			if (response.result == true || response.result == 'true') {
				${4}
			}
		},
		onFailure: function(){}
	}).send();
# confirm
snippet confirm(echo_confirm)
	new ConfirmBox({message:'${1:message}', action: function(){
		${2://code}
	}})
# ---------------------------------javascript-----------------------------------
# Prototype
snippet proto
	${1:class_name}.prototype.${2:method_name} =
	function(${3:first_argument}) {
		${4:// body...}
	};
# Function
snippet fun
	function ${1:function_name} (${2:argument}) {
		${3:// body...}
	}
# Anonymous Function
snippet f
	function(${1}) {${2}}
# if
snippet if
	if (${1:true}) {
		${2}
	}
# if ... else
snippet ife
	if (${1:true}) {
		${2}
	} else {
		${3}
	}
# tertiary conditional
snippet t
	${1:/* condition */} ? ${2:a} : ${3:b}
# switch
snippet switch
	switch(${1:expression}) {
		case '${3:case}':
			${4:// code}
			break;
		${5}
		default:
			${2:// code}
	}
# case
snippet case
	case '${1:case}':
		${2:// code}
		break;
	${3}
# for (...) {...}
snippet for
	for (var ${2:i} = 0,j = ${1:Things}.length; $2 < j; $2${3:++}) {
		${4:$1[$2]}
	};
# for (...) {...} (Improved Native For-Loop)
snippet forr
	for (var ${2:i} = ${1:Things}.length - 1; $2 >= 0; $2${3:--}) {
		${4:$1[$2]}
	};
snippet try
		try {
			$(1)
		} catch(e) {
			$(2)
		}
# while (...) {...}
snippet wh
	while (${1:/* condition */}) {
		${2:/* code */}
	}
# do...while
snippet do
	do {
		${2:/* code */}
	} while (${1:/* condition */});
# Object Method
snippet :f
	${1:method_name}: function(${2:attribute}) {
		${4}
	}${3:,}
# setTimeout function
snippet timeout
	setTimeout(function() {${3}}${2}, ${1:10};
# Get Elements
snippet get
	getElementsBy${1:TagName}('${2}')${3}
# Get Element
snippet gett
	getElementBy${1:Id}('${2}')${3}
# jQuery
snippet $
	$(${1:"selector"}).${2:method}(${3})${4};
snippet $(
	$(function(){
		${1://code}
	});
snippet $.each
	$.each(${1:array|object}, function(${2:o}){
		${3:this}
	});
snippet $$
	(function($){
		${1://code}
	})(jQuery);
snippet /*
	/**
	 * ${1:Describe what this method does}
	 * @param {${2:String|Object|Array|Boolean|Number}} ${3:paramName} ${4:Describe this parameter}
	 * @returns ${5:Describe what it returns}
	 */
snippet bug
	console.${1:log}(${2});
snippet single
	/**
	 * ${7:Describe what this singleton object does}
	 * @param {${8:String|Object|Array|Boolean|Number}} ${9:paramName} 
	 * @returns 
	 */
	var ${1:Singleton} = (function(){
		${2}
		return {
			${3:publicMethod}: function(${5:opt}) {
				${4://code}
			}${6:,}	
		};
	})();
snippet module
	/**
	 * ${5:Describe what this module does}
	 * @param {object} ${6:paramName}
	 */
	var ${1:classname} = (function(){
		var $1Object = {
			${2:privateMethod1}: function(){
				
			},
			${3:privateMethod2}: function(){
				
			}
		};
		return function(opt){
			var publicObj = {
				options: {},
				$2: $1Object.$2,
				$3: $1Object.$3${4:,} 
			};
			$.extend(publicObj.options, opt);
			return publicObj;
		};
	})();
# ---------------------------------html-----------------------------------
# Some useful Unicode entities
# Generic Doctype
snippet doctype HTML 4.01 Strict
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
	"http://www.w3.org/TR/html4/strict.dtd">
snippet doctype HTML 4.01 Transitional
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
	"http://www.w3.org/TR/html4/loose.dtd">
snippet doctype HTML 5
	<!DOCTYPE HTML>
snippet doctype XHTML 1.0 Frameset
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
snippet doctype XHTML 1.0 Strict
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
snippet doctype XHTML 1.0 Transitional
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
snippet doctype XHTML 1.1
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
# HTML Doctype 4.01 Strict
snippet docts
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""
	"http://www.w3.org/TR/html4/strict.dtd">
# HTML Doctype 4.01 Transitional
snippet doct
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""
	"http://www.w3.org/TR/html4/loose.dtd">
# HTML Doctype 5
snippet doct5
	<!DOCTYPE HTML>
# XHTML Doctype 1.0 Frameset
snippet docxf
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
# XHTML Doctype 1.0 Strict
snippet docxs
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
# XHTML Doctype 1.0 Transitional
snippet docxt
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
# XHTML Doctype 1.1
snippet docx
	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
	"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
snippet html
	<html>
	${1}
	</html>
snippet xhtml
	<html xmlns="http://www.w3.org/1999/xhtml">
	${1}
	</html>
snippet body
	<body>
		${1}
	</body>
snippet head
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8"`Close()`>

		<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>
		${2}
	</head>
snippet title
	<title>${1:`substitute(Filename('', 'Page Title'), '^.', '\u&', '')`}</title>${2}
snippet script
	<script type="text/javascript" charset="utf-8">
		${1}
	</script>${2}
snippet scriptsrc
	<script src="${1}.js" type="text/javascript" charset="utf-8"></script>${2}
snippet style
	<style type="text/css" media="${1:screen}">
		${2}
	</style>${3}
snippet base
	<base href="${1}" target="${2}"`Close()`>
snippet div_module
	<div ${1}="${2:name}">
		${3}
	</div>
snippet id
	id="${1}"
snippet cl
	class="${1}"
snippet a
	<a href="${1:#url}">${2:link}</a>
snippet br
	<br`Close()[1:]`>
snippet ul
	<ul>
		<li></li>
	</ul>
# Embed QT Movie
snippet movie
	<object width="$2" height="$3" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
	 codebase="http://www.apple.com/qtactivex/qtplugin.cab">
		<param name="src" value="$1"`Close()`>
		<param name="controller" value="$4"`Close()`>
		<param name="autoplay" value="$5"`Close()`>
		<embed src="${1:movie.mov}"
			width="${2:320}" height="${3:240}"
			controller="${4:true}" autoplay="${5:true}"
			scale="tofit" cache="true"
			pluginspage="http://www.apple.com/quicktime/download/"
		`Close()[1:]`>
	</object>${6}
snippet flash
	<object type="application/x-shockwave-flash" data="${1:.swf}" width="${2:400}" height="${3:300}">
		<param name="movie" value="$1" width="$2" height="$3" />
		<param name="wmode" value="transparent">
		<param name="allowScriptAccess" value="always" />
		<param name="allowFullScreen" value="true">
	</object>
snippet fieldset
	<fieldset id="$1">
		<legend>${1:name}</legend>
		${3}
	</fieldset>
snippet form
	<form action="${1:`Filename('$1_submit')`}" method="${2:get}" accept-charset="utf-8">
		${3}
		<p><input type="submit" value="Submit"`Close()`></p>
	</form>
snippet h1
	<h1 id="${1:heading}">${2:$1}</h1>
snippet input
	<input type="${1:text/submit/hidden/button}" name="${2:some_name}" value="${3}"`Close()`>${4}
snippet label
	<label for="${2:$1}">${1:name}</label><input type="${3:text/submit/hidden/button}" name="${4:$2}" value="${5}" id="${6:$2}"`Close()`>${7}
snippet link
	<link rel="${1:stylesheet}" href="${2:/css/master.css}" type="text/css" media="${3:screen}" charset="utf-8"`Close()`>${4}
snippet mailto
	<a href="mailto:${1:joe@example.com}?subject=${2:feedback}">${3:email me}</a>
snippet meta
	<meta name="${1:name}" content="${2:content}"`Close()`>${3}
snippet opt
	<option value="${1:option}">${2:$1}</option>${3}
snippet optt
	<option>${1:option}</option>${2}
snippet select
	<select name="${1:some_name}" id="${2:$1}">
		<option value="${3:option}">${4:$3}</option>
	</select>${5}
snippet table
	<table border="${1:0}">
		<tr><th>${2:Header}</th></tr>
		<tr><th>${3:Data}</th></tr>
	</table>${4}
snippet textarea
	<textarea name="${1:Name}" rows="${2:8}" cols="${3:40}">${4}</textarea>${5}
# Non-Breaking Space
snippet nbs
	&nbsp;
# ←
snippet left
	&#x2190;
# →
snippet right
	&#x2192;
# ↑
snippet up
	&#x2191;
# ↓
snippet down
	&#x2193;
# ↩
snippet return
	&#x21A9;
# ⇤
snippet backtab
	&#x21E4;
# ⇥
snippet tab
	&#x21E5;
# ⇧
snippet shift
	&#x21E7;
# ⌃
snippet control
	&#x2303;
# ⌅
snippet enter
	&#x2305;
# ⌘
snippet command
	&#x2318;
# ⌥
snippet option
	&#x2325;
# ⌦
snippet delete
	&#x2326;
# ⌫
snippet backspace
	&#x232B;
# ⎋
snippet escape
	&#x238B;
# echo popup
snippet popup
	<div id="${1:div_id}" class="popup" style="display:none;">
		<div class="sect">
			<h2>
				<span class="title" onmousedown="new Draggable.drag(event);">title</span>
				<span class="extra" onclick="$('${2:div_id}').tHide();">关闭</span>
			</h2>
			<div class="sectContent gForm">
				<div class="row">
					<label>现有频道：</label>
					<div class="col">
						<table id="table" class="sTable">
							<tr>
							{% for channel in channels %}
								<td>{{ channel.name }}</td>
								{% if loop.index % 3 == 0 %}</tr><tr>{% endif %}
							{% endfor %}
							</tr>
						</table>
					</div>
				</div>
				<div class="sectBtn">
					<input type="text" id="channel_name" name="channel_name" class="inputbox" />
					<input id="edit_channel" type="button" class="button" value="确定" onclick="do_edit_channel();" />
				</div>
			</div>
		</div>
	</div>
# comment // --------------------------------------------------------------------
snippet //-
	// --------------------------------------------------------------------
# comment // ---------------------------- zhangpeng -----------------------------
snippet //
	// ---------------------------- zhangpeng -----------------------------
